<me:UIWF x:Class="WPFExcelReport.TSWS06"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport" 
                    xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL" 
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls"  
                    xmlns:WS="clr-namespace:WPFExcelReport;assembly=TWASTAMM" 
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization" 
                    x:Name="TV"
                    Loaded="Window_Loaded"
     >
    <me:UIWF.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>       <CollectionViewSource  x:Key="vwDetail"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:NOTBoolToVisibilityConverter x:Key="nbv"/>
        <ucd:TextTrimmingConverter  x:Key="trim"/>
    </me:UIWF.Resources>
    <StackPanel>
        <WrapPanel  Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource bv}}">

            <WS:TSWS02 Name="cWS02" Grid.Column="0" 
                   WALIEFNR="{Binding LIEFNR,ElementName=TV}"
                   dwWS="{Binding dwWS,ElementName=TV}"
                   KEY="{Binding EXAUF,ElementName=TV}" 
                   />
            <Button  Grid.Row="0"  Grid.Column="1"  Click="ManageCommand" Width="24" Height="20" 
                 Visibility="{Binding IsMaster, Converter={StaticResource bv}}">
                <Button.Background>
                    <ImageBrush  ImageSource="/ImagePackage;component/Images/Extend.png" />
                </Button.Background>
            </Button>
            <TextBlock Grid.Row="0"  Grid.Column="0"   Text="{Binding Source={Localization:Translate Word=颜色:}}"></TextBlock>
            <ComboBox DropDownOpened="ComboBox_DropDownOpened"
                    Grid.Row="0"  Grid.Column="1"
                    IsEditable="True"
                     Width="60" 
                    SelectedValuePath="KEY"
                    DisplayMemberPath="KEY"  
                    ItemsSource="{Binding Source={StaticResource vwMaster}}"  
                    IsSynchronizedWithCurrentItem="True" 
            >
            </ComboBox  >
            <TextBlock  Grid.Row="0"  Grid.Column="2"  HorizontalAlignment="Left" 
                        Text="{Binding WAFBEZ,Converter={StaticResource trim},Source={StaticResource vwMaster}}"
                        Width="60" />
        </WrapPanel>
        <WrapPanel Visibility="Collapsed">
            <WrapPanel Grid.Row="0">
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=品种:}}"></TextBlock>
                    <TextBlock  Grid.Column="1"  Text="{Binding WAFART,Source={StaticResource vwMaster}}" Width="100"  />
                </Grid>
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=色号:}}"></TextBlock>
                    <TextBlock  Grid.Column="1"  Text="{Binding WAFZUSATZ}" Width="40"  />
                </Grid>
            </WrapPanel>
        </WrapPanel>
    </StackPanel>
</me:UIWF>
